#include <stdio.h>
#include <math.h>
double calculate_percentage(double D) {
	if (D >= 120) {  // D大于等于120时，都不会满意
		return 0.000;
	} else if (D <= 0) {  // D小于等于0时，都会满意
		return 100.000;
	}
	
	int satisfied_count = 0;
	int total_count = 86400;
	
	for (int hour = 0; hour < 24; hour++) {
		for (int minute = 0; minute < 60; minute++) {
			for (int second = 0; second < 60; second++) {
				double angle_hour = (hour % 12 + minute / 60.0 + second / 3600.0) * 30;  // 每小时30度
				double angle_minute = (minute + second / 60.0) * 6;  // 每分钟6度
				double angle_second = second * 6;  // 每秒钟6度
				
				// 计算三个指针之间的夹角
				double diff1 = fabs(angle_hour - angle_minute);
				double diff2 = fabs(angle_hour - angle_second);
				double diff3 = fabs(angle_minute - angle_second);
				
				// 判断是否满意
				if (diff1 >= D && diff2 >= D && diff3 >= D) {
					satisfied_count++;
				}
			}
		}
	}
	
	double percentage = satisfied_count / (double)total_count * 100;
	return percentage;
}

int main() {
	double D;
	
	// 读入输入的D值，并计算输出满意的百分比
	while (1) {
		scanf("%lf", &D);
		if (D == -1) {
			break;
		}
		double percentage = calculate_percentage(D);
		printf("%.3lf\n", percentage);
	}
	
	return 0;
}
